package main

import "fmt"

/**
 * @param n: the number of disks
 * @return: the order of moves
 */
func TowerOfHanoi(n int) []string {
	ans := []string{}
	hnt(n, "A", "B", "C", &ans)
	return ans
}

func move(a, c string, ans *[]string) {
	*ans = append(*ans, "from "+a+" to "+c)
}

func hnt(n int, a, b, c string, ans *[]string) {
	if n == 1 {
		move(a, c, ans)
	} else {
		hnt(n-1, a, c, b, ans)
		move(a, c, ans)
		hnt(n-1, b, a, c, ans)
	}
}

func main() {
	fmt.Println(TowerOfHanoi(2))
	fmt.Println(TowerOfHanoi(3))
}
